#ifndef SEATRESERVE_H
#define SEATRESERVE_H

#include <QWidget>
#include"reservehome.h"
#include"QPushButton"
namespace Ui {
class seatReserve;
}

class seatReserve : public QWidget
{
    Q_OBJECT

public:
    explicit seatReserve(QWidget *parent = nullptr);
    ~seatReserve();

private slots:
    void on_pushButton_7_clicked();

    void on_pushButton_clicked();

    void on_pushButton_3_clicked();

    void on_pushButton_4_clicked();

    void on_pushButton_5_clicked();

    void on_pushButton_6_clicked();
    void keyPressEvent(QKeyEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

    void on_pushButton_2_clicked();

private:
    Ui::seatReserve *ui;
    QPoint initialMousePosition;
    int  keyPositon=1;
    bool isDragging = false;
    bool campus_selected=false;
    bool floor_selected=false;
    bool area_selected=false;
    QString basicStyle = "QPushButton {"
                "color: black;"
                "border: 2px solid #e0ffff; /* 设置边框宽度和透明颜色 */"
                "border-radius: 10px; /* 设置圆角半径为20像素 */"
                "}"
                "QPushButton:hover {"
                "color: green; /* 鼠标悬停状态 */"
                "border: 2px solid #e0ffff; /* 设置边框宽度和透明颜色 */"
                "border-radius: 10px; /* 设置圆角半径为20像素 */"
                "background-color:#e0ffff;"
                "}"
                "QPushButton:pressed {"
                "color: red; /* 按钮被按下状态 */"
                "border: 2px solid #e0ffff; /* 设置边框宽度和透明颜色 */"
                "border-radius: 10px; /* 设置圆角半径为20像素 */"
                "}";

public:
    void updateFloor(int indexCampus);
    void updateArea(int indexCampus,int indexFloor,QPushButton *button);
    void updateSeat(int i,QPushButton *button);

};

#endif // SEATRESERVE_H
